# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AuthorizedBuyersMarketplace.V1.Model.RtbMetrics do
  @moduledoc """
  Real-time bidding metrics. For what each metric means refer to [Report metrics](https://support.google.com/adxbuyer/answer/6115195#report-metrics)

  ## Attributes

  *   `adImpressions7Days` (*type:* `String.t`, *default:* `nil`) - Ad impressions in last 7 days.
  *   `bidRate7Days` (*type:* `float()`, *default:* `nil`) - Bid rate in last 7 days, calculated by (bids / bid requests).
  *   `bidRequests7Days` (*type:* `String.t`, *default:* `nil`) - Bid requests in last 7 days.
  *   `bids7Days` (*type:* `String.t`, *default:* `nil`) - Bids in last 7 days.
  *   `filteredBidRate7Days` (*type:* `float()`, *default:* `nil`) - Filtered bid rate in last 7 days, calculated by (filtered bids / bids).
  *   `mustBidRateCurrentMonth` (*type:* `float()`, *default:* `nil`) - Must bid rate for current month.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adImpressions7Days => String.t() | nil,
          :bidRate7Days => float() | nil,
          :bidRequests7Days => String.t() | nil,
          :bids7Days => String.t() | nil,
          :filteredBidRate7Days => float() | nil,
          :mustBidRateCurrentMonth => float() | nil
        }

  field(:adImpressions7Days)
  field(:bidRate7Days)
  field(:bidRequests7Days)
  field(:bids7Days)
  field(:filteredBidRate7Days)
  field(:mustBidRateCurrentMonth)
end

defimpl Poison.Decoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.RtbMetrics do
  def decode(value, options) do
    GoogleApi.AuthorizedBuyersMarketplace.V1.Model.RtbMetrics.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.RtbMetrics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
